package com.example.demo.common.utils;

import org.springframework.stereotype.Service;

import java.net.Inet4Address;
import java.net.UnknownHostException;

@Service
public class IpUtil {

    public String getIp(){
        String ip;
        try {
            ip = Inet4Address.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
            ip = "912";
        };
        return ip;
    }


}
